package cn.yusei.teamTribe.constant;

import java.lang.reflect.Field;

public class Modules {

	public static final int PORTRAIT = 0;
	
	public static final int POST_IMAGE = 1;
	
	public static final int TEAM_PHOTO = 2;
	
	public static final int TEAM_VIDEO = 3;
	
	public static final int TEAM_WALLPAPER = 4;
	
	private static final Field[] fields = Modules.class.getDeclaredFields(); 
	
	private static String modules[] = {"portrait", "post_image", "team_photo", "team_video","team_wallpaper"};
	
	public static boolean isModule(int module) {
		try{
			for(Field field : fields) {
				if(field.getInt(Modules.class) == module)
					return true;
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	}
	
	public static String getModuleName(int mod)
	{
		try
		{
			return modules[mod];
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
		return null;
	}
}
